package com.example.demo.mapper;

import com.example.demo.controller.vo.OrderDetailVo;
import com.example.demo.entity.OrderPO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;


@Mapper
public interface OrderMapper {

    @Select("select * from tb_order where id = #{orderId} ")
    OrderPO selectOrderByOrderId(long orderId);

    @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
    @Insert("insert into tb_order (saleNums,readySum,createTime,beginTime," +
            "imgUrl,realCost,tag,time,title,totalSum,updateTime) values(#{saleNums} ,#{readySum} ,#{createTime} ,#{beginTime} ,#{imgUrl} ,#{realCost} ,#{tag} ," +
            "#{time} ,#{title} ,#{totalSum} ,#{updateTime})")
    void addOrder(OrderPO orderPO);
}
